/**
 * @Author
 * @AIDE AIDE+
 */
package com.libgdxbar.pvzlikegame.android;

import android.content.Intent;
import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.libgdxbar.pvzlikegame.MainGame;

public class AndroidGdxLauncher extends AndroidApplication {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		initLaunchOptions();
		UncaughtExceptionActivity.setUncaughtExceptionHandler(this);

		AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
		configuration.useImmersiveMode = true;
		initialize(new MainGame(), configuration);
	}

	private void initLaunchOptions() {
		createShortCuts();
		Intent launchIntent = getIntent();
		boolean isHideBlackBar = launchIntent.getBooleanExtra("isHideBlackBar", false);
		if(isHideBlackBar) ScreenUtils.hideBlackBar(this);
	}

	private void createShortCuts() {
		AppShortCutUtils.createShortcut(this);
	}
}
